package com.gorkr.servicepassengeruser.controller;

import com.gorkr.servicepassengeruser.service.PassengerUserService;
import com.mashibing.internalcommon.dto.ResponseResult;
import com.mashibing.internalcommon.dto.servicepassengeruser.request.LoginRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author gorkr
 * @date 2022/05/28 15:45
 **/

@RestController
@RequestMapping("/auth")
@Slf4j
public class AuthController {

    @Resource
    private PassengerUserService passengerUserService;

    @PostMapping("/login")
    public ResponseResult login(@RequestBody LoginRequest request){
        log.info("/auth/login");
        String passengerPhone = request.getPassengerPhone();
        return passengerUserService.login(passengerPhone);
    }
}
    